export default {
    // 封装的跳转页面事件 navigateTo
    navigateTo(url,data){
        let arr = []
        if(!!data){
            for (const strKey in data) {
                if(data[strKey] != undefined || data[strKey] == '' || data[strKey] == null){
                    arr.push(strKey + '=' + data[strKey])
                }
            }
        }
        if(arr.length > 0 ){
            uni.navigateTo({
                url:`${url}?${arr.join('&')}`
            })
        }else {
            uni.navigateTo({
                url:`${url}`
            })
        }
    },
    swichNav(url){
        uni.switchTab({
            url: url
        })
    },
    reLaunch(url,data){
        let arr = []
        if(!!data){
            for (const strKey in data) {
                if(data[strKey] != undefined || data[strKey] == '' || data[strKey] == null){
                    arr.push(strKey + '=' + data[strKey])
                }
            }
        }
        if(arr.length > 0 ){
            uni.navigateTo({
                url:`${url}?${arr.join('&')}`
            })
        }else {
            uni.navigateTo({
                url:`${url}`
            })
        }
    }
}